package com.heima.utils.common;

import com.heima.model.wemedia.pojos.WmMaterial;
import com.heima.model.wemedia.pojos.WmUser;

/**
 * @author rookie001
 * @creat 2023-06-07-11:04
 */
public class WmThreadLocalUtils {
    private final static ThreadLocal<WmUser> WM_USER_THREAD_LOCAL = new ThreadLocal<WmUser>();

    //添加用户
    public static void setUser(WmUser user) {
        WM_USER_THREAD_LOCAL.set(user);
    }

    //获取用户
    public static WmUser getUser() {
        return WM_USER_THREAD_LOCAL.get();
    }

    //清理用户
    public static void clear() {
        WM_USER_THREAD_LOCAL.remove();
    }
}